cmake_minimum_required(VERSION 3.16)

project(rabbitmq_linux_test LANGUAGES C)

add_library(examples-common OBJECT)
target_sources(examples-common PRIVATE
  utils.h
  utils.c)
if(WIN32)
  target_sources(examples-common PRIVATE win32/platform_utils.c)
else()
  target_sources(examples-common PRIVATE unix/platform_utils.c)
endif()
target_link_libraries(examples-common PRIVATE rabbitmq)

add_executable(rabbitmq_linux_test main.c)


target_link_libraries(rabbitmq_linux_test examples-common rabbitmq)


include(GNUInstallDirs)
install(TARGETS rabbitmq_linux_test
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
